import {
  post,
  get,
  put,
  dalete,
  postJosn,
  putone,
  patch,
  daleteJson,
  download,
} from '../utils/request';

//分页查询预售活动列表
export function queryPreSaleActList(data) {
  return post('/api/flashsale-service/v1/presale/queryPreSaleActList', data);
  //return post('http://127.0.0.1:18080/api/promotion-service/v1/promotionBuyFree/qryBuyFreeActiviteList', data);
}

//发布撤回活动
export function setActStatus(data) {
  return post('/api/flashsale-service/v1/presale/setActStatus', data);
  //return post('http://127.0.0.1:18080/api/promotion-service/v1/promotionBuyFree/editBuyFreeActiviteInfo?uuid='+data.uuid+'&status='+data.status);
}

//创建预售活动（全部数据）
export function addPreSaleAct(data) {
  return post('/api/flashsale-service/v1/presale/addPreSaleAct', data);
  //return post('http://127.0.0.1:18080/api/promotion-service/v1/promotionBuyFree/editBuyFreeActivite', data);
}

//修改预售活动
export function updatePreSaleAct(data) {
  return post('/api/flashsale-service/v1/presale/updatePreSaleAct', data);
  //return post('http://127.0.0.1:18080/api/promotion-service/v1/promotionBuyFree/editBuyFreeActivite', data);
}

//查询参与门店信息
export function queryJoinStoreInfo(data) {
  return post('/api/flashsale-service/v1/presale/queryJoinStoreInfo', data);
  //return post('http://127.0.0.1:18080/api/promotion-service/v1/promotionBuyFree/editBuyFreeActivite', data);
}

//查询参与门店信息导出
export function toExcelJoinStore(data) {
  return download('/api/flashsale-service/v1/presale/toExcelJoinStore', data);
}

// 查询所有大区
export function getWarzoneList(data) {
  return post('/api/user-service/v1/detail/getWarzoneList ', data);
}
//查询门店=分页
export function queryStoreInfo(data) {
  return post('/api/user-service/v1/organization/queryStoreInfo', data);
}
//删除活动
export function deleteGoodsActivity(data) {}

//获取活动详细
export function getActInfoById(data) {
  return post('/api/flashsale-service/v1/presale/getActInfoById', data);
  //return post('http://127.0.0.1:18080/api/promotion-service/v1/promotionBuyFree/qryBuyFreeActiviteInfo?uuid='+data.uuid);
}

//活动商品分类列表
export function qryGoodsTypeList(data) {
  return post('/api/goods-service/v1/foreignGoods/qryGoodsTypeList', data);
  //return post('http://127.0.0.1:18080/api/goods-service/v1/foreignGoods/qryGoodsTypeList', data);
}

//挑选商品
export function queryChooseGoodsList(data) {
  return post('/api/goods-service/v1/foreignGoods/qryBuyFreeGoodsList', data);
  //return post('http://127.0.0.1:18080/api/goods-service/v1/foreignGoods/qryBuyFreeGoodsList', data);
}

//挑选赠品
export function queryChooseGiftsList(data) {}

//活动列表
export function qrySpecialActivityList(data) {
  return post(
    '/api/member-service/v1/BonuspointRule/qrySpecialActivityList',
    data
  );
}
//保存活动（全部数据）
export function saveSpecialActivityConfig(data) {
  return post(
    'api/member-service/v1/BonuspointRule/saveSpecialActivityConfig',
    data
  );
}
//活动
export function qrySpecialActivityInfo(data) {
  return get(
    '/api/member-service/v1/BonuspointRule/qrySpecialActivityInfo?uuid=' +
      data.uuid
  );
}

// 保存活动修改记录
export function addActivityModificationRecord(data) {
  return post(
    '/api/flashsale-service/v1/activityModificationRecord/addActivityModificationRecord',
    data
  );
}

// 查询活动修改记录
export function queryActivityModificationRecord(data) {
  return post(
    '/api/flashsale-service/v1/activityModificationRecord/queryActivityModificationRecord',
    data
  );
}

// 导出活动修改记录
export function exportActivityModificationRecord(data) {
  return download(
    '/api/flashsale-service/v1/activityModificationRecord/exportActivityModificationRecord',
    data
  );
}
